package com.daon.controller;

import com.daon.pojo.SysEnterprise;
import com.daon.service.ISysEnterpriseManageService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

/**
 * @Author 1daon
 * @EMAIL 532418116@qq.com
 * @Version 创建时间：2019/3/22 3:04 PM
 * @Modified By
 */
@Controller
@RequestMapping("/sys/enterpriseManage")
public class SysEnterpriseManageController {

    @Autowired
    private ISysEnterpriseManageService iSysEnterpriseManageService;

    @RequestMapping("index.page")
    public ModelAndView index(@RequestParam(value = "pageNum",defaultValue = "1") int pageNum,
                              @RequestParam(value = "pageSize",defaultValue = "10") int pageSize,
                              @RequestParam(value = "keyword", defaultValue = "") String keyword){
        ModelAndView mav = new ModelAndView("/backend/enterpriseManage/index");
        PageInfo sysEnterpriseList = iSysEnterpriseManageService.getEnterpriseListByKeyword(pageNum, pageSize, keyword);
        mav.getModel().put("sysEnterpriseList", sysEnterpriseList);
        return mav;
    }
}
